<!--
 * @Description: 定时任务表单
 * @Autor: Zhu_liangyu
 * @Date: 2020-05-20 20:29:09
--> 
<template>
  <basic-form
    ref="cronTaskForm"
    primary-key="cronTaskId"
    form-type="dialog"
    v-model="cronTaskForm"
    :rules="cronTaskRule"
    :query-api="cronTask_queryByIdApi"
    :insert-api="cronTask_insertApi"
    :update-api="cronTask_updateApi"
  >
    <a-form-model-item label="任务名称" prop="cronTaskName" ref="cronTaskName" :hasFeedback="true">
      <a-input v-model="cronTaskForm.cronTaskName" placeholder="请输入任务名称" />
    </a-form-model-item>
    <a-form-model-item label="任务编号" prop="cronTaskNo" ref="cronTaskNo" :hasFeedback="true">
      <a-input v-model.number="cronTaskForm.cronTaskNo" placeholder="请输入任务编号" />
    </a-form-model-item>
    <a-form-model-item label="表达式" prop="cronExpression" ref="cronExpression" :hasFeedback="true">
      <a-input v-model="cronTaskForm.cronExpression" placeholder="请输入表达式" />
    </a-form-model-item>
    <a-form-model-item label="执行类" prop="className" ref="className" :hasFeedback="true">
      <a-input v-model="cronTaskForm.className" placeholder="请输入执行类" />
    </a-form-model-item>
    <a-form-model-item label="任务状态" prop="active" ref="active">
      <a-switch v-model="cronTaskForm.active" />
    </a-form-model-item>
    <a-form-model-item label="任务详情" prop="description" ref="description" :hasFeedback="true">
      <a-input v-model="cronTaskForm.description" type="textarea" placeholder="请输入任务详情" />
    </a-form-model-item>
  </basic-form>
</template>
<script>
import {
  cronTask_queryByIdApi,
  cronTask_insertApi,
  cronTask_updateApi
} from "@/api/cms/cronTask";
import { cronTaskRule } from "@/profile/cms/cronTask";

export default {
  props: {
    cronTaskId: {
      //数据字典类别标识
      type: String
    }
  },
  data() {
    return {
      cronTask_queryByIdApi,
      cronTask_insertApi,
      cronTask_updateApi,
      cronTaskForm: {
        cronTaskId: this.cronTaskId,
        active: true
      },
      cronTaskRule
    };
  }
};
</script>